New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added CL/CV Support and tests #19
Conversation
Hello @flabbet! Thanks for updating this PR.
Comment last updated at 2020-01-27 20:25:34 UTC |
Codecov Report
@@ Coverage Diff @@
## master #19 +/- ##
=========================================
Coverage ? 55.39%
=========================================
Files ? 3
Lines ? 343
Branches ? 46
=========================================
Hits ? 190
Misses ? 146
Partials ? 7
Continue to review full report at Codecov.
|
Wrote 5 tests. Tomorrow I'll write some more |
I covered most of main functions, except ones that use |
@@ -50,10 +50,10 @@ | |||
|
|||
SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{username}.mysql.pythonanywhere-services." \ | |||
"com/{username}${databasename}".format( | |||
username=username, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this maybe? formatting changes interfere with reviewing the main code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still slightly different :P
tests/test_issue_maker.py
Outdated
def test_that_title_mismatches(self): | ||
from swaglyrics_backend.issue_maker import is_title_mismatched | ||
self.assertTrue( | ||
is_title_mismatched({"Bohemian", "Rhapsody", "by", "Queen"}, "Miracle by Caravan Palace", 2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you pass a set instead of a normal string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check is_title_mismatched
function, it accepts words as first parameter and full title as second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right so actually we call split() which returns a list. The thing with set is that every element should be unique which may not exist for some songs. You should use a list here to mimic as close to the actual functioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swaglyrics-backend/issue_maker.py
Line 148 in fda9ffe
words = title.split() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that set must have unique values, I'll change that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed merge conflict. But somehow codecov broke. Logs look normal, idk why. I don't think it's my fault. EDIT: It fixed itself somehow |
I added a CL/CV (Travis CL, code Codecov) support and one test, that passes.
EDIT: Set up test enviroment with all enviroment variables. I am currently writing more tests